//package com.itheima.health.controller;
//
//import org.apache.poi.ss.usermodel.Workbook;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//import java.net.URLEncoder;
//
//public class post {
//
//    @RequestMapping("exportAccountBalance/{json}")
//    @ResponseBody
//    public void exportCashierData(@PathVariable String json, HttpSession session, HttpServletResponse response) throws Exception {
//
//        List<AccountBalance> list = getAccountBalanceListForTableOrExport(json, session, true);
//
//        getExportAccountBalance(list, fileName, time, session, response);
//    }
//    public void getExportAccountBalance(List<AccountBalance> list, String fileName, String time, HttpSession session, HttpServletResponse response) {
// doExport(fileName, response, wb);}
//
//
//    private static void doExport(String fileName,
//                                HttpServletResponse response,
//                                Workbook workbook) {
//        try {
//            response.setCharacterEncoding("UTF-8");
//            response.setHeader("content-Type", "application/vnd.ms-excel");
//            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
//            workbook.write(response.getOutputStream());
//        } catch (IOException e) {
//            throw new RuntimeException(e.getMessage());
//        }
//    }
//}
